<template>
  <div id="app">
    <!-- <test-button></test-button> -->
    <login-module2></login-module2>
    <!-- <login-module2></login-module2> -->
    <!--    <my-order></my-order>-->
    <setup-list :setupList='setupList'></setup-list>
  </div>
</template>

<script>
import LoginModuleVue from './components/LoginModule.vue'
import MyOrderVue from './components/MyOrder.vue'
import SetupListVue from './components/SetupList.vue'
import { getUserInfo } from 'vue-xiaobu-utils'
import LoginModule2Vue from './components/LoginModule2.vue'
import TestButtonVue from '../../components/testbutton/TestButton.vue'
export default {
  components: {
    'login-module': LoginModuleVue,
    'my-order': MyOrderVue,
    'setup-list': SetupListVue,
    'login-module2': LoginModule2Vue,
    'test-button': TestButtonVue
  },
  created() {
    // 在UI渲染前获取登录状态传入vuex中
    this.$store.dispatch('fetchLoginStatus', parseInt(getUserInfo().IS_LOGIN))
  },
  mounted() {
    this.addListener()
  },
  data() {
    return {
      setupList: window.SETUP_LIST
    }
  },
  methods: {
    addListener() {
      document.addEventListener('resume', () => {
        this.$store.dispatch('fetchLoginStatus', parseInt(getUserInfo().IS_LOGIN))
        this.$store.dispatch('fetchResumeCount')
      }, false)
    }
  }
}
</script>

<style>
html,
#app {
  background-color: #f2f5f6;
  height: 100%;
}
</style>
